package com.yohann.designPattern.facade;

/**
 * <p>
 * 外观
 * </p>
 *
 * @author Yohann
 * @since 2021/2/8 13:19
 */
public class HomeTheaterFacade {
    private TheaterLight light;
    private DVDPlayer player;
    private Popcorn popcorn;
    private Projector projector;
    private Screen screen;
    private Stereo stereo;

    public HomeTheaterFacade() {
        this.light = TheaterLight.getInstance();
        this.player = DVDPlayer.getInstance();
        this.popcorn = Popcorn.getInstance();
        this.projector = Projector.getInstance();
        this.screen = Screen.getInstance();
        this.stereo = Stereo.getInstance();
    }

    public void ready(){
        popcorn.on();
        popcorn.pop();
        screen.down();
        projector.on();
        stereo.on();
        player.on();
        light.dim();
    }

    public void play(){
        player.play();
    }

    public void pause(){
        player.pause();
    }

    public void end(){
        popcorn.off();
        light.bright();
        screen.up();
        projector.off();
        stereo.off();
        player.off();
    }
}